package translate;

import temp.*;
import tree.*;

abstract class Cx extends Exp{
	
	@Override
	tree.Exp unEx() {
		Temp r = new Temp();
		Label t = new Label();
		Label f = new Label();
		return new tree.ESEQ (new tree.SEQ(new tree.MOVE(new tree.TEMP(r), 
										   				 new tree.CONST(1)), 
										   new tree.SEQ(unCx(t,f), 
												   		new tree.SEQ(new tree.LABEL(f), 
												   		new tree.SEQ(new tree.MOVE(new tree.TEMP(r), 
												   								   new tree.CONST(0)), 
												   					 new tree.LABEL(t))))), 
							  new tree.TEMP(r));
	}

	@Override
	Stm unNx() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	abstract tree.Exp unCx(Label t, Label f);
	
}
